//
//  CBGCarFilesVC.m
//  chebabaGYS
//
//  Created by yisu on 15/12/26.
//  Copyright © 2015年 zhengminjie. All rights reserved.
//

#import "CBGCarFilesVC.h"
#import "CustomDefine.h"
#import "CBGCarFilesData.h"

@interface CBGCarFilesVC ()<UITableViewDelegate, UITableViewDataSource>{

    
}
 
@property (weak, nonatomic) IBOutlet UIView *bottomView;
@property (nonatomic, strong) UITableView *tableView_;
@property (nonatomic, strong) NSMutableArray *allCarfiles;
@property (nonatomic, strong) NSArray *allCarfiles1;
@end

@implementation CBGCarFilesVC

- (NSMutableArray *)allCarfiles{

    if (!_allCarfiles) {
        _allCarfiles = [NSMutableArray array];
    }
    return _allCarfiles;
}


- (void)viewDidLoad {
    [super viewDidLoad];
    [self creatTableView];
    [self tableViewData];
}

- (void)creatTableView{

    self.tableView_ = [[UITableView alloc] initWithFrame:CGRectMake(0, -64, __kWidth, __kHeight)];
    self.tableView_.backgroundColor = [UIColor whiteColor];
    self.tableView_.delegate = self;
    self.tableView_.dataSource = self;
    _tableView_.separatorStyle = UITableViewCellSeparatorStyleNone;
    [self.bottomView addSubview:self.tableView_];
}

//数据请求
- (void)tableViewData{

    self.allCarfiles1 = [CBGCarFilesData CarFilesAllData];
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 2;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
    if (!cell) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];
        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
        CBGCarFilesData *allCarfiles = self.allCarfiles1[indexPath.row];
        
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        //cell.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.05];
        UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, __kWidth-50, 80)];
        view.backgroundColor = [UIColor whiteColor];
        [cell.contentView addSubview:view];
        
        
        UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(15, 10, 130, 24)];
        label.font = MFont(12);
        label.textColor = [UIColor blackColor];
        label.text = allCarfiles.timeString;
        [view addSubview:label];
        
        UILabel *label1 = [[UILabel alloc] initWithFrame:CGRectMake(130 + 15, 10, 60, 24)];
        label1.font = MFont(12);
        label1.textColor = [UIColor blackColor];
        label1.text = allCarfiles.statusString;
        [view addSubview:label1];
        
        UILabel *label2 = [[UILabel alloc] initWithFrame:CGRectMake(15, 40, 50, 24)];
        label2.font = MFont(12);
        label2.textColor = [UIColor blackColor];
        label2.text = allCarfiles.qingxiu_yuyue_String;
        [view addSubview:label2];
    }
    
    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{

    return 70;
}


- (IBAction)backBtnAtion:(id)sender {
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
